package com.PhilXwj.lovenote;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.Toast;

import org.angmarch.views.NiceSpinner;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //设置导航栏透明
        setStatusBarTransparent();

        //待办项下拉框
        NiceSpinner spinner_listType = findViewById(R.id.spinner_listType);
        ArrayAdapter<CharSequence> adapter_listType = ArrayAdapter.createFromResource(getApplicationContext(), R.array.listType, android.R.layout.simple_spinner_item);
        adapter_listType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        spinner_listType.setAdapter(adapter_listType);
    }

    protected void setStatusBarTransparent() {
        View decorView = getWindow().getDecorView();
        int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
        decorView.setSystemUiVisibility(option);
        getWindow().setStatusBarColor(Color.TRANSPARENT);//透明
        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
    }
}

